package cn.blnp.net.flowable.task.ext.decision;

import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.JavaDelegate;
import org.springframework.stereotype.Component;

/**
 * <h3></h3>
 *
 * @author <a href="mailto:blnp.yibin@qq.com">lyb</a>
 * @version 1.0
 * @since 2025/5/19 13:54
 */
@Slf4j
@Component
public class Deduction2JavaDelegate implements JavaDelegate {

    @Override
    public void execute(DelegateExecution execution) {
        Number originalTotalPrice = (Number)execution.getVariable("originalTotalPrice");
        Number actualTotalPrice = (Number)execution.getVariable("actualTotalPrice");
        Number discountRatio = (Number)execution.getVariable("discountRatio");
        log.info("折扣前消费金额：{}，折扣率：{}，折扣后实际消费金额：{}", originalTotalPrice,
                discountRatio, actualTotalPrice);
    }
}
